package eleven;

import java.io.DataOutputStream;
import java.io.IOException;
import java.net.Socket;

public class TCPClient {
    public static void main(String[] args) throws IOException {
        System.out.println("-------Client------");
        Socket client = new Socket("localhost", 8888);
        DataOutputStream dos = new DataOutputStream(client.getOutputStream());
        String str = "hello";
        dos.writeUTF("UTF-8");
        dos.writeBytes(str);
        dos.flush();
        dos.close();
        client.close();
    }
}
